<?php
namespace app\index\controller;

class News extends Base {
	public function news_detail() {
		$data = model("News")->get_data(['item_id' => input("param.id/d")]);
		$this->assign('data', $data);
		$this->assign('type', isset($this->postData['type']) ? $this->postData['type'] : 2);
		return $this->fetch();
	}
	public function protocol() {

		return $this->fetch();
	}
	public function aboutus() {
		// $version = config('MP_VERSION');
		// $versions = json_decode(json_encode($version), true);
		// $i = 0;
		// foreach ($versions as $version) {
		// 	$i++;
		// 	if ($i > 1) {
		// 		break;
		// 	}

		// 	$versiond = $version['version'];
		// }
		// $this->assign('version', $version);
		$this->assign('title', '关于我们');
		return $this->fetch();
	}
	public function content() {
		if (isset($this->postData['catid']) && !isset($this->postData['id'])) {
			$info = model('Content')->where('catid', $this->postData['catid'])->find();
		} else {
			$info = model('Content')->get_data(['item_id' => $this->postData['id']]);
		}
		$this->assign('info', $info);
		$this->assign('title', $info['title'] ? str_cut($info['title'], 50) : '精彩文章');
		return $this->fetch();
	}
	public function bus_card() {
		$info = model('Client')->get_data(['item_id' => $this->postData['clientid']]);
		$this->assign('info', $info);
		return $this->fetch();
	}
	public function poster_image() {
		$info = model('Poster')->get_data(['item_id' => $this->postData['poster_id']]);
		$this->assign('info', $info);
		return $this->fetch();
	}
}